﻿namespace NTLib.Pipe.Descriptors
{
    using NTLib.Core.Descriptors;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Target description used to define that the pipe must be local.
    /// </summary>
    public sealed class LocalTargetDescription : Descriptor, ITargetDescriptor
    {
        #region Fields

        private const string NAME = "MEMORY_LOCAL";
        private static readonly LocalTargetDescription s_instance = new LocalTargetDescription();

        #endregion

        #region Ctor

        /// <summary>
        /// Prevents a default instance of the <see cref="LocalTargetDescription"/> class from being created.
        /// </summary>
        private LocalTargetDescription()
            : base(new Guid("78128644-42f8-4e6a-9261-0e4ee62170db"), NAME)
        {
        }

        #endregion

        #region Property

        /// <summary>
        /// Gets the singleton instance.
        /// </summary>
        public static LocalTargetDescription Instance
        {
            get { return s_instance; }
        }

        /// <summary>
        /// Equalses the specified other.
        /// </summary>
        /// <param name="other">The other.</param>
        /// <returns></returns>
        public bool Equals(ITargetDescriptor other)
        {
            return other is LocalTargetDescription;
        }

        #endregion
    }
}
